let we = require('../../we/index.js')
new class extends we.Page {
    data() {
        return {
            vo: {
                goodsList: []
            }
        }
    }

    onLoad() {
        this.getGoodsInfo()
    }

    getGoodsInfo() {
        this.$post('/product/list').then(res=> {
            this.setData({
                'vo.goodsList': res
            })
            wx.setStorageSync('goods', JSON.stringify(res))
        }).catch(err=> {
            wx.showModal({
                title: "错误",
                content: err.message,
                showCancel: false
            })
        })
    }

    onShareAppMessage() {
        return {
            title: '和好友组团拼手气，奖品免费拿～',
            path: '/pages/index/index',
            success: (res) => {
                this.$post('/user/inviteFriend', {type: 1}).then((res)=> {
                }).catch(err=> {
                })
            },
            fail:(err)=>{
            }
        }
    }
}